package com.ssm.controller;

import com.ssm.model.Order;
import com.ssm.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.jws.WebParam;
import javax.xml.ws.Service;
import java.util.List;


@Controller
public class OrderController {
    @Autowired
    OrderService orderService;

    @RequestMapping("/ssss")
    public String selectAllOrder(Model model)
    {
        List<Order> orders = orderService.selectAllOrder();
        model.addAttribute("orders", orders);
        return "order";
    }

    @RequestMapping("/toordermanage")
    public String toordermanage(Model model)
    {
        List<Order> orders = orderService.selectAllOrder();
        model.addAttribute("orders", orders);
        return "orders_manage";
    }
}
